package itheima.com.Day13.Test2;

public class Desk {
    //定义汉堡包数量
//    public static int count =10;
    //私有成员变量，将其改为带参构造进行调用
    private int count;

    //同时定义标记
    //有为 true  没有 false
//    public static boolean flag =false;
    private boolean flag;

    //需要锁对象保存数据共享
//    public static Object lock = new Object();
    private final Object lock = new Object();

    public Desk(int count, boolean flag) {
        this.count = count;
        this.flag = flag;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public Object getLock() {
        return lock;
    }

    @Override
    public String toString() {
        return "Desk{" +
                "count=" + count +
                ", flag=" + flag +
                ", lock=" + lock +
                '}';
    }

    public Desk() {
        this(10,false);
    }
}
